package com.woshua.jsonknife;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.woshua.annotation.ViewInjector;
import com.woshua.knifelibrary.ButterView;

public class MainActivity extends AppCompatActivity {

    @ViewInjector(R.id.tv_text)
    TextView tvText;
    @ViewInjector(R.id.tv_text_one)
    TextView tvTextOne;
    @ViewInjector(R.id.tv_text_two)
    TextView tvTextTwo;
    @ViewInjector(R.id.btn_click_me)
    TextView btnClickMe;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ButterView.inject(this);

        tvTextOne.setText("你好赵宏图");
        tvText.setText("你好世界");
        tvTextTwo.setText("你好Steven");
        btnClickMe.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(MainActivity.this,"我被点击了",Toast.LENGTH_SHORT).show();
            }
        });
    }
}
